package com.behome.netty.common.enums;


import com.behome.netty.common.ByteConventerKit;
import lombok.Getter;


/**
 * 终端国标参数代码
 */
@Getter
public enum TerminalParamCode {
    volume((byte) 0x01, "终端音量"),
    ip((byte) 0x02, "本地地址"),
    return_address((byte) 0x03, "回传地址"),
    resource_code((byte) 0x04, "终端资源编码"),
    physical_address((byte) 0x05, "物理地址编码"),
    work_status((byte) 0x06, "工作状态"),
    fault_code((byte) 0x07, "故障代码"),
    device_type((byte) 0x08, "设备类型"),
    hardware_version((byte) 0x09, "硬件版本号"),
    software_version((byte) 0x0A, "软件版本号"),
    fm_signal_status((byte) 0x0B, "调频信号状态"),
    dvb_c_signal_status((byte) 0x0C, "有线信号状态"),
    dtmb_signal_status((byte) 0x0D, "地面无线信号状态"),
    dvb_frequency((byte) 0x0E, "有线频率"),
    dtmb_frequency((byte) 0x0F, "地面无线频率"),
    fm_scan_frequency_list((byte) 0x10, "FM频点扫描列表"),
    fm_frequency((byte) 0x11, "FM当前频点"),
    fm_keep_mode((byte) 0x12, "FM维持指令模式"),
    audio_return_address((byte) -13, "音频回传地址"),
    fourth_status((byte) 25, "4G网络状态"),
    fourth_network_intensity((byte) 26, "网络信号强度"),
    fourth_network_useflag((byte) 27, "否允许使用网络"),
    fourth_network_connect((byte) 28, "是否连接网络"),
    fourth_network_ip((byte) 29, "设备是否获取IP"),
    wire_param((byte) 33, "有线服器参数"),
    wireless_param((byte) 34, "无线服器参数");
    private byte value;
    private String name;

    private TerminalParamCode(byte value, String name) {
        this.value = value;
        this.name = name;
    }

    public String toString() {
        return "(指令名称:" + this.name + ",指令类型:" + ByteConventerKit.byteToHexStr(this.value, true, true) + ")";
    }

    public static TerminalParamCode getEnumTypeByValue(byte value) {
        TerminalParamCode[] var1 = values();
        for (TerminalParamCode type : var1) {
            if (type.value == value) {
                return type;
            }
        }
        return null;
    }
}
